package com.example.canalclientsync.canal.mapper.db1;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.canalclientsync.canal.po.Project;
import org.apache.ibatis.annotations.Mapper;

/**
 * 项目相关查询
 *
 * @author chen.cr
 * @since 2023/9/15
 */
@Mapper
public interface ProjectMapper extends BaseMapper<Project> {

//    @Select("SELECT * FROM t_project WHERE id = #{projectId} AND tenant_id = #{tenantId}")
    Project findByProjectIdAndTenantId(Integer projectId, String tenantId);

    /**
     * 查询附件所在的项目
     *
     * @param attachModelId 附件模型ID
     * @param tenantId 租户ID
     * @return
     */
    Project findByAttachmentModelIdAndTenantId(Long attachModelId, String tenantId);


}
